package Dao;

import java.sql.*;

public class BaseDao {

    public Connection getConnection(){
        try {
            Class.forName("com.mysql.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/liuzu?createDatabaseIfNotExist=true&useSSL=false",
                    "root", "123456");
            return conn;
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }

    /*public static void main(String[] args) {
        System.out.println("new BaseDao().getConnection() = " + new BaseDao().getConnection());
    }*/
}
